import Opt from '@/components/dt/info/Opt.js'

class Column extends Opt {
  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        field: 'companyName',
        title: '所属组织',
        minWidth: 160
      },
      {
        field: 'housesName',
        title: '案场名称',
        minWidth: 180
      },
      {
        field: 'commissionMonth',
        title: '结算月份',
        minWidth: 100
      },
      {
        field: 'commissionName',
        title: '结算单名称',
        minWidth: 150
      },
      {
        field: 'settlementTypeStr',
        title: '结算类型',
        minWidth: 120,
        header: {
          filter: {
            title: '结算类型',
            placeholder: '全部',
            key: 'settlementType',
            select: {
              key: 'settlementType',
              clearable: true
            }
          }
        }
      },
      {
        field: 'preCommissionAmount',
        title: '本次应结佣金(元)',
        minWidth: 140,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'voucherStatusStr',
        title: '凭证是否上传',
        minWidth: 130,
        header: {
          filter: {
            title: '凭证是否上传',
            placeholder: '全部',
            key: 'voucherStatus',
            select: {
              options: [
                { key: '1', value: '已上传' },
                { key: '2', value: '未上传' }
              ],
              clearable: true
            }
          }
        }
      },
      {
        field: 'voucherAttachTypeStr',
        title: '确认凭证类型',
        minWidth: 160,
        header: {
          filter: {
            title: '确认凭证类型',
            placeholder: '全部',
            key: 'voucherAttachType',
            select: {
              key: 'voucherAttachType',
              clearable: true
            }
          }
        }
      },
      {
        field: 'confirmDate',
        title: '确认日期',
        minWidth: 120,
        cell: {
          text: {
            type: 'date'
          }
        }
      },
      {
        field: 'voucherConfirmAmount',
        title: '确认金额(元)',
        minWidth: 120,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settlementStatusStr',
        title: '核销状态',
        minWidth: 120,
        header: {
          filter: {
            title: '核销状态',
            placeholder: '全部',
            key: 'settlementStatus',
            select: {
              key: 'WriteOffStatus',
              clearable: true
            }
          }
        }
      },
      {
        field: 'writtenOffAmount',
        title: '核销金额(元)',
        minWidth: 120,
        cell: {
          text: {
            type: 'number'
          }
        }
      }
    ]
  }
}

export default Column
